#include <iostream>
#include <string>

#include "level.hpp"
#include "util.hpp"
#include "format.hpp"
using namespace std;

// int main()
// {
//     cout<<log::util::Date::now()<<endl;
//     string fpath = "./abc/def/x.txt";
//     log::util::File::createDirectory(log::util::File::path(fpath));
//     return 0;
// }

// int main()
// {
//     cout<<Log::LogLevel::toString(Log::LogLevel::value::DEBUG)<<endl;
//     cout<<Log::LogLevel::toString(Log::LogLevel::value::INFO)<<endl;
//     cout<<Log::LogLevel::toString(Log::LogLevel::value::ERROR)<<endl;
//     cout<<Log::LogLevel::toString(Log::LogLevel::value::WARN)<<endl;
//     cout<<Log::LogLevel::toString(Log::LogLevel::value::FATAL)<<endl;
//     cout<<Log::LogLevel::toString(Log::LogLevel::value::OFF)<<endl;
//     cout<<Log::LogLevel::toString(Log::LogLevel::value::UNKNOW)<<endl;

//     return 0;
// }

// int main()
// {
//     Log::LogMsg msg(Log::LogLevel::value::DEBUG,__LINE__,__FILE__,"root","检测");
//     Log::FormatItem::ptr fmt(new Log::LevelFormatItem);
//     fmt.reset(new Log::FileFormatItem);
//     fmt.reset(new Log::TimeFormatItem("%Y-%m-%d|%H:%M:%S"));
//     fmt.reset(new Log::LoggerFormatItem);
//     fmt.reset(new Log::MsgFormatItem);

//     fmt->format(cout,msg);
//     return 0;
// }

int main()
{
    Log::LogMsg msg(Log::LogLevel::value::DEBUG,__LINE__,__FILE__,"root","检测");
    Log::Formatter fmter("[%d{%Y-%m-%d|%H:%M:%S}][%t][%c][%f:%l][%p]%T%m%n");
    std::cout<<fmter.format(msg);
    
    return 0;
}